import axios from 'axios';
import request from 'src/utils/request'

export async function getAllPeriods() {
  return axios.get('/api/periods');
}
export async function jsapiSign(data) {
  return axios.post('/api/jsapiSign', data);
}
export async function getPrepayId(data) {
  console.log('TCL: getPrepayId -> data', data);
  let result = axios.post('/api/prepayId', data);
  console.log('TCL: getPrepayId -> result', result);
  return result;
}

export async function getTemporaryQCode() {
  return axios.get('/api/getTemporaryQCode');
}

export async function queryAllFactoryVedio() {
  return axios.get('/api/regioncategorys');
}

export async function queryAllCms() {
  return axios.get('/api/information');
}

export async function getPaySign(data) {
  return axios.post('/api/paySign', data);
}

export async function getOrderWithPeriodId(period_id) {
  return request.get('/api/orders', {params: {period_id}})
}

export async function initUser(code,state='weixin') {
  return request.get('/api/init', {params:{code,state}})
}
export async function getImgCode() {
  return request.get('/api/getImgCode')
}
export async function sendSignUpCode(data) {
  return request.post('/api/sendSignUpCode', data)
}
export async function bindPhone(data) {
  return request.post('/api/bindPhone', data)
}
export async function getAllRedPkgList() {
  return request.get('/api/redPkgs')
}
export async function getBankCardList() {
  return request.get('/api/getBankCardList')
}
export async function pointSign() {
  return request.get('/api/pointSign')
}
export async function feedSign() {
  return request.get('/api/feedSign')
}
export async function waterSign() {
  return request.get('/api/waterSign')
}
export async function getZhuangyuanInfo() {
  return request.get('/api/getZhuangyuanInfo')
}
export async function getCaiyuanInfo() {
  return request.get('/api/getCaiyuanInfo')
}
export async function feedChick() {
  return request.get('/api/feedChick')
}
export async function waterVagetable() {
  return request.get('/api/waterVagetable')
}
export async function getUserNiubi() {
  return request.get('/api/getUserNiubi')
}
export async function getNiubiRecordWithType() {
  return request.get('/api/getNiubiRecordWithType')
}
export async function checkHasShiMimg() {
  return request.get('/api/checkHasShiMimg')
}
export async function checkIsPcLogin() {
  return request.get('/api/checkIsPcLogin')
}
export async function getUserInfo() {
  return request.get('/api/getUserInfo')
}
export async function logout() {
  return request.get('/api/logout')
}
export async function getAllNotification() {
  return request.get('/api/notifications')
}
export async function transferGoodParam(params) {
  return request.get('/api/transferGoodParam', {params})
}
export async function changePointsToFeed(params) {
  return request.get('/api/changePointsToFeed', {params})
}
export async function changePointsToWater(params) {
  return request.get('/api/changePointsToWater', {params})
}
export async function geRedPkgRecord(id) {
  return request.get(`/api/redPkgs/${id}`)
}
export async function getContract(id) {
  return request.get(`/api/orders/${id}`)
}
export async function checkHasGetRedPkg(id) {
  return request.get('/api/checkHasGetRedPkg',{params:{id}})
}
export async function getRedPkg(data) {
  return request.post('/api/getRedPkg', data)
}
export async function checkBankFourItem(data) {
  return request.post('/api/checkBankFourItem', data)
}
export async function h5Pay(data) {
  return request.post('/api/h5Pay', data)
}
